	    <% content_for :sidebar do -%>
            <div class="side_box">
                <ul class="menu">
                    <%= return_post_path(@post)%>
                </ul>
            </div>
            
            <% if @related_posts.size > 0 -%>
            <div class="tab">
  		<h3>相关的其他帖子</h3>
	    </div>
	    <div class="clear">
		<% for post in @related_posts -%>
		    <%= post_path(post)%>
		    <span class="postsubinfo">(<%= post.replies.size%>个回复
		    <% if @post.class == CommonPost -%>
			,<%= post.voteuseful_count%>/<%= post.voteuseful_count + post.voteuseless_count%>的人觉得有用)
		    <%end -%>
		    </span>
		    <span class="sub_i"><%= local_date post.created_at%></span>
		    <br/>
		<% end -%>
	    </div>
            <% end -%>
            
            <% if @posts_of_same_cat.size > 0 -%>
	    <div class="tab">
  		<% if @post.class == CommonPost -%>
		    <h3><%=@post.post_category.title%>下的其他帖子</h3>
		<% end -%>
		<% if @post.class == GroupPost -%>
		    <h3><%=@post.group.title%>下的其他帖子</h3>
		<% end -%>
		<% if @post.class == SitePost -%>
		    <h3><%=@post.site.title%>下的其他帖子</h3>
		<% end -%>
	    </div>
	    <div class="clear">
		<% for post in @posts_of_same_cat -%>
		    <%= post_path(post)%>
		    <span class="postsubinfo">(<%= post.replies.size%>个回复
		    <% if @post.class == CommonPost -%>
			,<%= post.voteuseful_count%>/<%= post.voteuseful_count + post.voteuseless_count%>的人觉得有用)
		    <%end -%>
		    </span>
		    <span class="sub_i"><%= local_date post.created_at%></span>
		    <br/>
		<% end -%>
	    </div>
            <% end -%>
            <br/>
            <script type="text/JavaScript"> 
              alimama_pid="mm_10195837_873999_1782343"; 
              alimama_titlecolor="FFFB88"; 
              alimama_descolor ="FFFFFF"; 
              alimama_bgcolor="FFFFFF"; 
              alimama_bordercolor="007D18"; 
              alimama_linkcolor="FFFB88"; 
              alimama_bottomcolor="FFFFFF"; 
              alimama_anglesize="10"; 
              alimama_bgpic="8"; 
              alimama_icon="1"; 
              alimama_sizecode="23"; 
              alimama_width=160; 
              alimama_height=600; 
              alimama_type=2; 
            </script> 
            <script src="http://a.alimama.cn/inf.js" type="text/javascript"> 
            </script>
                    
	    <% end -%>
            
            <% content_for :navbar do -%>
            <div class="box">
                <img class="map" align="absmiddle" alt="You are here" src="/images/map.png"/>
		当前位置
		» <%= link_to "您这儿", :controller =>'browse', :action => 'index' %> 
		<%= current_position_post_path(@post) %>
		» <%= @post.title%>
		<%= rss_post_path(@post) %>
            </div>
            <% end -%>
            <div class="box">
                <table width="99%">
		    <tr>
			<td valign="top" align="center" width="10%">
			    <%= render :partial => 'shared/userPorlet', :object =>@post.user%>
			</td>
			<td valign="top" align="center" width="90%">
                        <table cellspacing="0" cellpadding="0" border="0" width="99%">
                            <tr>
                                <td width="25" height="30" class="lt"/>
                                <td height="30" class="ct"/>
                                <td width="11" height="30" class="rt"/>
                            </tr>
                            <tr>
                                <td width="25" valign="top" class="lm"/>
                                <td valign="top" class="origin">
                                <h1 class="title"><%= @post.title%></h1>
			        <p>
				    <span class="sub_i">
				    <%if current_user == @post.user -%>
				        <%= post_edit_path(@post)%>
				    <%end -%>
                                    <%if current_user == @post.user || (@post.class == GroupPost && @post.group.is_admin?(current_user)) || (@post.class == SitePost && @post.site.user == current_user) || (@post.class == CommonPost && @post.community.can_edit?(current_user)) -%>
                                        <%= post_delete_path(@post)%>
				    <%end -%>
				    <%=local_date @post.created_at%>
				    标签:
				    <% if !@tags.nil? -%>
				        <% for tag in @tags -%>
					    <%= link_to "#{tag.name}", tag_path(tag.name)%> 
				        <% end -%>
				    <% end -%>
				    </span>
			        </p>
			        <%= @post.content%>
                                </td>
                                <td width="11" class="rm"/>
                            </tr>
                            <tr>
                                <td width="25" height="32" class="lb"/>
                                <td height="25" class="cb"/>
                                <td width="11" height="32" class="rb"/>
                            </tr>
                        </table>
			</td>
		    </tr>
		    <tr>
			<td colspan="2">
			<% if @post.class == CommonPost -%>
                        <hr/>
			    <div id="update_div">
				<table border="0">
				    <tr>
					<td>
					    <%= @post.voteuseful_count%>/<%= @post.voteuseful_count + @post.voteuseless_count%>的人觉得有用
					</td>
                                        <% if current_user.nil? -%>
                                        <td>
					    ，登陆后对该主题进行投票。
					</td>
                                        <% elsif current_user != @post.user && !check_post_vote(@post) -%>
                                        <td>
					    ，此条消息对你
                                            <%= image_tag("/images/loadingw.gif", :id => "loading-gif", :style => "display:none")%>
					</td>
					<td>
					    <div id = "voteusefule_form">
					    <% form_remote_tag(:update => "update_div", :url => {:controller => 'posts', :action => 'voteuseful'},:loading => "Element.show('loading-gif'),Element.hide('voteusefule_form'),Element.hide('voteuseless_form')",:complete => "Element.hide('loading-gif'),Element.hide('voteusefule_form'),Element.hide('voteuseless_form')") do -%>
					        <input id="post_id" name="post[id]" type="hidden" value="<%=@post.id%>"/>
					        <%= submit_tag "有用" %>
					    <% end -%>
					    </div>
					</td>
					<td>
					    <div id = "voteuseless_form">
					    <% form_remote_tag(:update => "update_div", :url => {:controller => 'posts', :action => 'voteuseless'},:loading => "Element.show('loading-gif'),Element.hide('voteusefule_form'),Element.hide('voteuseless_form')",:complete => "Element.hide('loading-gif'),Element.hide('voteusefule_form'),Element.hide('voteuseless_form')") do -%>
					        <input id="post_id" name="post[id]" type="hidden" value="<%=@post.id%>"/>
					        <%= submit_tag "没用" %>
					    <% end -%>
					    </div>
					</td>
                                        <% elsif current_user == @post.user -%>
					<td>
					    。
					</td>
                                        <% else -%>
					<td>
					    ，你已对该主题进行过投票。
					</td>
                                        <% end -%>
                                        
				    </tr>
				</table>
			    </div>
			<% end -%>
			</td>
		    </tr>
		</table>
            </div>
	    <div class="box">
		<% if @post.replies.size > 0 -%>
		    <%= image_tag("comments.png", :align=>"absmiddle")%> 回复......
		    <hr/>
		    <%=render :partial => 'shared/replies', :object => @post.replies%>
		<% else -%>
		    <p class="greenfont">目前这个主题还没有回复</p>
		<% end -%>
                <hr/>
		<% if !current_user.nil? -%>
		    <%= image_tag("comments_add.png", :align=>"absmiddle")%> 回复一下吧
		    <%= render(:partial => "replies/form")%>
		<% else -%>
		    你<%= link_to "登录", :controller => 'users', :action => 'login' %>后才可以发表评论
		<% end -%>
	    </div>

